package com.dwd.basic.utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/1/5 13:18
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("返回请求处理")
public class AjaxResult {
    @ApiModelProperty("是否正确")
    private Boolean success = true;
    @ApiModelProperty("错误消息")
    private String message = "操作成功";
    @ApiModelProperty("附加")
    private Object resultObj;

    public AjaxResult(String message) {
        this.success = false;
        this.message = message;
    }

    public static AjaxResult me() {
        return new AjaxResult();
    }

    public AjaxResult getResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
